package cn.caskm.souvenirshopsystem.controller.admin;

import cn.caskm.souvenirshopsystem.domain.Result;
import cn.caskm.souvenirshopsystem.domain.vo.CategoryStatsVO;
import cn.caskm.souvenirshopsystem.domain.vo.DashboardStatsVO;
import cn.caskm.souvenirshopsystem.domain.vo.SalesTrendVO;
import cn.caskm.souvenirshopsystem.service.DashboardService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/dashboard")
@RequiredArgsConstructor
public class AdminDashboardController {

    private final DashboardService dashboardService;

    @GetMapping("/stats")
    public Result<DashboardStatsVO> getDashboardStats() {
        return dashboardService.getDashboardStats();
    }

    @GetMapping("/salesTrend")
    public Result<SalesTrendVO> getSalesTrend() {
        return dashboardService.getSalesTrend();
    }

    @GetMapping("/categoryStats")
    public Result<CategoryStatsVO> getCategoryStats() {
        return dashboardService.getCategoryStats();
    }

}
